package com.kaifamiao.www.demo.do0908;

import com.mysql.cj.jdbc.MysqlDataSource;
import org.apache.commons.dbutils.QueryRunner;

import javax.sql.DataSource;


public class Demo01 {
    public static void main(String[] args) {
        DataSource dateSource = initDateSource();

    }

    public static DataSource initDateSource(){
        String url = "jdbc:mysql://localhost:3306/kfm";
        String user = "root";
        String password = "";
        MysqlDataSource dataSource = new MysqlDataSource();
        dataSource.setURL(url);
        dataSource.setUser(user);
        dataSource.setPassword(password);
        return dataSource;
    }

    public static void insert(QueryRunner runner){
        String sql = "insert into emp(ename,job,mgr,hiredate,sal,comm,deptno) values(?,?,?,?,?,?,?)";

    }

    public static void queryOne(QueryRunner runner){
        String sql = "select * from emp where ";
    }
}
